/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aljfce.business.event.control;

import com.aljfce.business.entity.Event;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
import org.primefaces.model.DefaultScheduleEvent;
import org.primefaces.model.ScheduleEvent;

/**
 *
 * @author Jacopo Ferrigno <jacopo.ferrigno@gmail.com>
 */
public class EventWrapper extends DefaultScheduleEvent{
    
    private Event event;
   
    
    
    /**
     * Public constructor. Takes no parameters.
     * 
     */
    public EventWrapper() {    
        
    }
    
    public EventWrapper(Event event){
        this.event = event;
    }

    /**
     * Get the value of event
     *
     * @return the value of event
     */
    public Event getEvent() {
        return event;
    }

    /**
     * Set the value of event
     *
     * @param event new value of event
     */
    public void setEvent(Event event) {
        this.event = event;
    }


    @Override
    public String getTitle() {
        return this.event.getTitle();
    }

    @Override
    public void setTitle(String title) {
       this.event.setTitle(title); //To change body of generated methods, choose Tools | Templates.
    }
    
    

    @Override
    public Date getStartDate() {
      return this.event.getStartingDate();
    }

    @Override
    public void setStartDate(Date startDate) {
       this.event.setStartingDate(startDate); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public boolean equals(Object obj) {
        if(!(obj instanceof EventManager))
            return false;
        if(!this.event.getId().equals(((EventWrapper) obj).getEvent().getId() ))
            return false;
        return true;
    }
    
    
    
    
    

    @Override
    public Date getEndDate() {
        return this.event.getEndingTime();
    }

    @Override
    public void setEndDate(Date endDate) {
        this.event.setEndingTime(endDate); //To change body of generated methods, choose Tools | Templates.
    }


    @Override
    public String getDescription() {
        return this.event.getDescription();
    }

    @Override
    public void setDescription(String description) {
       this.event.setDescription(description);
    }

    @Override
    public boolean isEditable() {
        return false; 
    }
    
    

   

   

    
    
    
    
    
    
    
    
}
